package com.heima.admin.controller;

import com.heima.admin.service.AdUserService;
import com.heima.common.dtos.ResponseResult;
import com.heima.model.admin.dtos.AdUserDto;
import com.heima.model.admin.dtos.AdUserLoginDto;
import com.heima.model.user.dtos.UserAuthDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.Map;

/**
 * @Author RMY
 * @Date 2021/11/24 17:31
 * @Version 1.0
 */
@RestController
public class LoginController {
    @Autowired
    private AdUserService adUserService;

    /**
     * 管理后台登陆
     * @param adUserLoginDto
     * @return
     */
    @PostMapping("/login/in")
    public ResponseResult<Map<String,Object>> login(@Valid @RequestBody AdUserLoginDto adUserLoginDto){
        //调用service
        return adUserService.login(adUserLoginDto);
    }
}
